/*
 * @Author: 来自火星的码农 15122322+heyzhi@user.noreply.gitee.com
 * @Date: 2025-06-24 17:09:54
 * @LastEditors: 来自火星的码农 15122322+heyzhi@user.noreply.gitee.com
 * @LastEditTime: 2025-08-22 05:12:55
 * @FilePath: /server/workspace/src/base/Singleton.h
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
#ifndef __SINGLETON__H__
#define __SINGLETON__H__
#include<memory>
namespace Yizhi{
    template <class T,class X=void,int N=0>
class Singleton{
    public:
    static T* GetInstance(){
        static T v;
        return &v;
    }
};

template <class T,class X=void,int N=0>
class Singletonptr{
    public:
    static std::shared_ptr<T> GetInstance(){
        static std::shared_ptr<T> ptr(new T);
        return ptr;
    }
};
}


#endif